package com.sy.simpleegg.ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.lifecycleScope
import com.sy.simpleegg.R
import com.sy.simpleegg.base.BaseMvpFragment
import com.sy.simpleegg.databinding.FragmentUpgradeBinding
import com.sy.simpleegg.ext.logFile
import com.sy.simpleegg.mvp.contract.PackageManageContract
import com.sy.simpleegg.mvp.presenter.PackageManagePresenter

class UpgradeFragment :
    BaseMvpFragment<PackageManageContract.View, PackageManageContract.Presenter, FragmentUpgradeBinding>(),
    PackageManageContract.View {

    companion object {
        fun getInstance(): UpgradeFragment = UpgradeFragment()
    }

    override fun createPresenter(): PackageManageContract.Presenter = PackageManagePresenter(lifecycleScope)

    override fun attachLayoutRes(): Int = R.layout.fragment_upgrade

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        openEventBus = false
        isCountDownBackHome = false
    }

    override fun initView(view: View) {
        super.initView(view)

    }

    override fun getViewBinding(
        inflater: LayoutInflater,
        container: ViewGroup?,
    ): FragmentUpgradeBinding {
        return FragmentUpgradeBinding.inflate(inflater, container, false)
    }

    override fun lazyLoad() {

    }

    override fun onResume() {
        super.onResume()
        logFile("${javaClass.simpleName} onResume")
    }

    override fun onHiddenChanged(hidden: Boolean) {
        super.onHiddenChanged(hidden)
        if (hidden) {
            logFile("${javaClass.simpleName}隐藏")
        } else {
            logFile("${javaClass.simpleName}显示")
        }
    }


    override fun showLoading() {

    }

    override fun hideLoading() {

    }


}